package com.ihd.ihardware.view.lock.view;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.ihd.ihardware.R;
import com.ihd.ihardware.common.widget.SwipeItemLayout;
import com.ihd.ihardware.databinding.ActivityLockZwManagerBinding;
import com.ihd.ihardware.pojo.Test_zw;
import com.ihd.ihardware.view.lock.viewmodel.LockZWInputViewModel;

import java.util.ArrayList;
import java.util.List;

import cn.wowjoy.commonlibrary.base.BaseActivity;
import cn.wowjoy.commonlibrary.widget.titlebar.TitleBar;

public class LockZWManagerActivity extends BaseActivity<ActivityLockZwManagerBinding, LockZWInputViewModel> {

    List<Test_zw> md = new ArrayList<>();

    @Override
    protected void init(Bundle savedInstanceState) {
        mImmersionBar.statusBarDarkFont(false).init();

        binding.mtitlebar.setLeftBack(this);
        binding.mtitlebar.setLeftImageResource(R.drawable.lock_nb_back);
        binding.mtitlebar.setTitle("指纹管理");
        binding.mtitlebar.setTitleColor(getResources().getColor(R.color.C_FFFFFF));
        binding.mtitlebar.addAction(new TitleBar.Action() {
            @Override
            public String getText() {
                return null;
            }

            @Override
            public int getDrawable() {
                return R.drawable.lock_nb_notice;
            }

            @Override
            public void performAction(View view) {
                Intent mIntent = new Intent(LockZWManagerActivity.this, LockZWAuthActivity.class);
                startActivity(mIntent);
            }
        });

        binding.zwRV.addOnItemTouchListener(new SwipeItemLayout.OnSwipeItemTouchListener(this));
        binding.zwRV.setAdapter(viewModel.mZWAdapter);

        md.add(new Test_zw(R.drawable.lock_listicon_zw, "左手拇指"));
        md.add(new Test_zw(R.drawable.lock_listicon_zw, "小指"));
        md.add(new Test_zw(R.drawable.lock_listicon_zw, "中指"));
        md.add(new Test_zw(R.drawable.lock_listicon_admin, "猫爪"));
        viewModel.setMembers(md);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_lock_zw_manager;
    }

    @Override
    protected Class getViewModelClass() {
        return LockZWInputViewModel.class;
    }
}
